﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using F_SER.DAL;
using System.Data;

namespace F_SER.ServicePorts
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码、svc 和配置文件中的类名“ServiceHSH”。
    /// <summary>
    ///  会员充值接口
    /// </summary>
    public class ServiceHYCZ : IServiceHYCZ
    {
       Service1 Service = new Service1();
        Module.SysInfo sysInfo = new Module.SysInfo();


      /// <summary>
      /// 卡号检测(预充值)
      /// </summary>
      /// <param name="admin">授权账号</param>
      /// <param name="pwd">授权KEY</param>
      /// <param name="carid">卡号</param>
      /// <param name="out_trade_no">充值流水号</param>
      /// <param name="money">预测值金额</param>
      /// <returns></returns>
        public bool caridCheckd(string admin, string pwd, string OP_id, string cardId, string money, string out_trade_no)
        {
            try
            {
                sysInfo.CMD = "01";
                sysInfo.value01 = admin;
                sysInfo.value02 = pwd;
                sysInfo.value03 = OP_id;
                sysInfo.value04 = cardId;
                sysInfo.value05 = money;
                sysInfo.value06 = out_trade_no;
                string result = Service.GetOutValue("[WP_WZCZ]", CodeHelper.xml(sysInfo));
                return true;
            }
            catch (Exception)
            {
                
                throw;
            }
        }

      /// <summary>
        /// 会员充值接口
      /// </summary>
      /// <param name="admin">授权key</param>
      /// <param name="pwd">加密key</param>
      /// <param name="OP_id">操作员8888</param>
      /// <param name="cardId">外卡号</param>
      /// <param name="money">金额</param>
      /// <returns></returns>
        public string hycz(string admin, string pwd, string OP_id, string cardId, string money, string out_trade_no)
        {

            try
            {
                sysInfo.CMD = "02";
                sysInfo.value01 = admin;
                sysInfo.value02 = pwd;
                sysInfo.value03 = OP_id;
                sysInfo.value04 = cardId;
                sysInfo.value05 = money;
                sysInfo.value06 = out_trade_no;
                string result = Service.GetOutValue("[WP_WZCZ]", CodeHelper.xml(sysInfo));
                return result;
            }
            catch (Exception)
            {
                
                throw;
            }
        }

    
    }
}
